{% load helpers %}
<tr>
    <td><a href="{{ service.get_absolute_url }}">{{ service.name }}</a></td>
    <td>{{ service.get_protocol_display }}</td>
    <td>{{ service.port_list }}</td>
    <td>
        {% for ip in service.ip_addresses.all %}
            {{ ip|hyperlinked_object }}<br>
        {% empty %}
            <span class="text-secondary">All IPs</span>
        {% endfor %}
    </td>
    <td>{{ service.description }}</td>
    <td class="text-end d-print-none">
        <a href="{% url 'ipam:service_changelog' pk=service.pk %}" class="btn btn-secondary btn-sm" title="Change log">
            <span class="mdi mdi-history"></span>
        </a>
        {% if perms.ipam.change_service %}
            <a href="{% url 'ipam:service_edit' pk=service.pk %}?return_url={{ service.parent.get_absolute_url }}" class="btn btn-info btn-sm" title="Edit service">
                <span class="mdi mdi-pencil"></span>
            </a>
        {% endif %}
        {% if perms.ipam.delete_service %}
            <a href="{% url 'ipam:service_delete' pk=service.pk %}?return_url={{ service.parent.get_absolute_url }}" class="btn btn-danger btn-sm">
                <span class="mdi mdi-trash-can-outline" title="Delete service"></span>
            </a>
        {% endif %}
    </td>
</tr>
